package com.aiyige.page.selectregion.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.selectregion.model.HeaderRegionItem;
import com.aiyige.page.selectregion.model.RegionItem;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by zhuyakun on 2017/10/26.
 */

public class SelectRegionAdapter extends BaseMultiItemQuickAdapter<RegionItem, BaseViewHolder> {

    public SelectRegionAdapter() {
        super(new LinkedList<RegionItem>());
        addItemType(RegionItem.TYPE_INDEX, R.layout.select_region_index);
        addItemType(RegionItem.TYPE_DATA, R.layout.select_region_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, RegionItem item) {
        switch (item.getItemType()) {
            case RegionItem.TYPE_DATA:
                helper.setText(R.id.itemTv, item.getName());
                break;
            case RegionItem.TYPE_INDEX:
                helper.setText(R.id.itemTv, item.getIndex());
                break;
            default:
                break;
        }
    }


}
